package com.atbeijing.bigdata.spark.core.rdd.operator.transform

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object Spark01_Oper_Transform_1 {

    def main(args: Array[String]): Unit = {

        val conf = new SparkConf().setMaster("local[*]").setAppName("TransformOperator")
        val sc = new SparkContext(conf)

        val rdd : RDD[Int] = sc.makeRDD(List(1,2,3,4),2)
        val rdd1: RDD[Int] = rdd.map(
            num => {
                println("num = " + num)
                num
            }
        )
        val rdd2: RDD[Int] = rdd1.map(
            num => {
                println(">>>>>>>> = " + num)
                num
            }
        )
        //println(rdd1.partitions.length)

        rdd2.collect()//.foreach(println)

        sc.stop()

    }
}
